group by, aggregate multiple column -pandas

38

df[['col1', 'col2', 'col3', 'col4']].groupby(['col1', 'col2']).agg(['mean', 'count'])

Comments

Submit
0 Comments